package pl.edu.pw.polygen.menu.commands;


import org.springframework.stereotype.Component;

import pl.edu.pw.polygen.MainWindow;
import pl.edu.pw.polygen.PolygenApplication;
import pl.edu.pw.polygen.modeler.server.EditorServer;
import pl.edu.pw.polygen.util.ApplicationHelper;
import pl.edu.pw.polygen.util.ApplicationHolder;

import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;

@Component
public class BoundaryIdicatorCommand implements Command {
	

	private static final long serialVersionUID = 7875336550119938214L;

	@Override
	public void menuSelected(MenuItem selectedItem) {
		System.out.println(selectedItem.getText());
		MainWindow mainWindow = (MainWindow) ((PolygenApplication)ApplicationHolder.getApplication()).getMainWindow();
		EditorServer editorServer = mainWindow.getSelectedEditorServer();
		editorServer.showBoundaries(selectedItem.isChecked());
	}
	

}
